/*
 *  LAWL.h
 *  TubeTruck
 *
 *  Created by Aeturnum on 6/5/08.
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
 *
 */

#pragma once

#include <vector>
#include <assert.h>
#include <exception>

#include "TubeTruckTypes.h"
#include "serialization.h"
#include "unserialization.h" 
#include "smartalloc_wrap.h"
#include "Signable.h"
#include "Signiture.h"
#include "Encryptable.h"
#include "RSA.h"
#include "util.h"

namespace TTP {
   class LAWL: public Packet, public Crypt::Signable {
      std::vector<byte> mGroupPublicKey;
   public:
      LAWL();
      LAWL(id_hash);
      LAWL(uint32_t, std::vector<byte>&, std::vector<byte>&);
      
      // accessors
      std::vector<byte> getGroupPublicKey() const;
      
      // modifier
      void setGroupPublicKey(std::vector<byte>&);
      
      // idHash
      void  setDestIdHash(id_hash);
      id_hash getDestIdHash() const;
      
      
      // inherited
      void fromVec(std::vector<byte>::const_iterator &vit, std::vector<byte>::const_iterator &end);
      void toVec(std::vector<byte> &vec) const;
      
      std::vector<byte> getUnsignedData() const;
   };
}